<div class="col_box">
    <div class="col_two clear">
        <dl id="billtype">
            <dt>类型：</dt>
            <dd>
                <?php foreach (get_bill_type() as $m => $n) { ?>
                    <input type="radio" name="row[type]" class="radio" id="r_<?= $m ?>" value="<?= $m ?>" <?= $m == $show['type'] ? 'checked disabled' : 'disabled' ?>/><label for="r_<?= $m ?>"><?= $n ?></label>
                <?php } ?>
            </dd>
        </dl>
        <div class="m_hide">
            <div id="h_expense">
                <select name="category_father_expense" id="category_father_expense" class="select">
                    <?= get_category_option('expense', 0, null, array(0 => '作为一级分类')) ?>
                </select>
            </div>
            <div id="h_income">
                <select name="category_father_income" id="category_father_income" class="select">
                    <?= get_category_option('income', 0, null, array(0 => '作为一级分类')) ?>
                </select>
            </div>
        </div>
        <?php if ($show['type'] == 'expense') { ?>
            <!--支出-->
            <div class="m_hide" id="m_expense" style="display:block;">
                <form class="validform" method="post" action="/bill/edit/<?=$show['id']?>/">
                    <dl><dt>时间：</dt>
                        <dd>
                            <input type="text" name="row[occurtime]" id="occurtime_expense" class="input datepicker" value="<?= date("Y-m-d", $show['occurtime']) ?>" title="点击选择日期" size="10" style="width:100px;" datatype="date" readonly="true" errormsg="日期输入错误！" autocomplete="off" />
                        </dd>
                    </dl>
                    <dl><dt>类别：</dt>
                        <dd>
                            <select name="row[category_id]" id="category_list_expense" class="select" datatype="*" nullmsg="请选择分类">
                                <?= get_category_option_full('expense', $show['category_id']); ?>
                            </select>
                            &nbsp;<a href="javascript:void(0);" title="新增分类" class="category_add" type="expense"><img src="<?= $config['res_url'] ?>/images/modify.gif" alt="" /></a>
                        </dd></dl>
                    <dl><dt>账户：</dt>
                        <dd>
                            <select name="row[account_id]" id="account_id_expense" class="select" datatype="*" nullmsg="请选择账户">
                                <?= get_account_option(null, $show['account_id']); ?>
                            </select>
                            &nbsp;<a href="/account/add/" title="新增账户" class="dialog account_add" callback="account_callback"><img src="<?= $config['res_url'] ?>/images/modify.gif" alt="" /></a>
                        </dd></dl>
                    <dl><dt>金额：</dt><dd><input type="text" name="row[amount]" value="<?= $show['amount'] ?>" id="money_expense" class="input calculator" size="10" maxlength="8" datatype="dec1" nullmsg="金额不能为空" errormsg="金额格式错误" /></dd></dl>
                    <dl><dt>说明：</dt><dd><textarea name="row[memo]" cols="55" rows="4" class="textarea"><?= $show['memo'] ?></textarea></dd></dl>
                    <dl><dt>&nbsp;</dt>
                        <dd>
                            <a href="javascript:void(0);" class="moreup" obj="moreconf"><span class="arrow"><em class="up">◆</em></span> 高级选项</a>
                            <div class="moreconf" style="clear:both;">
                                <input type="checkbox" name="row[notinfamily]" value="1" <?= checkchecked(0, $show['family']) ?> id="c_notinfamily_expense" class="checkbox" /> <label for="c_notinfamily_expense">不在家庭中显示</label>
                            </div>
                        </dd>
                    </dl>
                    <dl><dt>&nbsp;</dt>
                        <dd>
                            <a href="javascript:;" class="btn btn_s submit"><span><b class="icon icon-ok"></b><em>提交</em></span></a>
                            <a href="javascript:;" class="btn btn_w_s cancel"><span><b class="icon icon-remove"></b><em>取消</em></span></a>
                            <span class="poststate"><em>&nbsp;</em><b></b></span>
                        </dd></dl>
                </form>
            </div>
        <?php } else if ($show['type'] == 'income') { ?>
            <!--收入-->
            <div class="m_hide" id="m_income" style="display:block;">
                <form class="validform" method="post" action="/bill/edit/<?=$show['id']?>/">
                    <dl><dt>时间：</dt><dd><input type="text" name="row[occurtime]" id="occurtime_income" class="input datepicker" value="<?= date("Y-m-d", $show['occurtime']) ?>" title="点击选择日期" size="10" style="width:100px;" datatype="*" readonly="true" errormsg="日期输入错误！" autocomplete="off" /></dd></dl>
                    <dl><dt>类别：</dt>
                        <dd>
                            <select name="row[category_id]" id="category_list_income" class="select" datatype="*" nullmsg="请选择分类">
                                <?= get_category_option_full('income', $show['category_id']); ?>
                            </select>
                            &nbsp;<a href="javascript:void(0);" title="新增分类" class="category_add" type="income"><img src="<?= $config['res_url'] ?>/images/modify.gif" alt="" /></a>
                        </dd></dl>
                    <dl><dt>账户：</dt>
                        <dd>
                            <select name="row[account_id]" id="account_id_income" class="select" datatype="*" nullmsg="请选择账户">
                                <?= get_account_option(null, $show['account_id']); ?>
                            </select>
                            &nbsp;<a href="/account/add/" title="新增账户" class="dialog account_add" callback="account_callback"><img src="<?= $config['res_url'] ?>/images/modify.gif" alt="" /></a>
                        </dd></dl>
                    <dl><dt>金额：</dt><dd><input type="text" name="row[amount]" value="<?= $show['amount'] ?>" class="input calculator" size="5" maxlength="8" datatype="dec1" nullmsg="金额不能为空" errormsg="金额格式错误" /></dd></dl>
                    <dl><dt>说明：</dt><dd><textarea name="row[memo]" cols="55" rows="4" class="textarea"><?= $show['memo'] ?></textarea></dd></dl>
                    <dl><dt>&nbsp;</dt>
                        <dd>
                            <a href="javascript:void(0);" class="moreup" obj="moreconf"><span class="arrow"><em class="up">◆</em></span> 高级选项</a>
                            <div class="moreconf" style="clear:both;">
                                <input type="checkbox" name="row[notinfamily]" value="1" <?= checkchecked(0, $show['family']) ?> id="c_notinfamily_income" class="checkbox" /> <label for="c_notinfamily_income">不在家庭中显示</label>
                            </div>
                        </dd></dl>
                    <dl><dt>&nbsp;</dt>
                        <dd>
                            <a href="javascript:;" class="btn btn_s submit"><span><b class="icon icon-ok"></b><em>提交</em></span></a>
                            <a href="javascript:;" class="btn btn_w_s cancel"><span><b class="icon icon-remove"></b><em>取消</em></span></a>
                            <span class="poststate"><em>&nbsp;</em><b></b></span>
                        </dd></dl>
                </form>
            </div>
        <?php } else if ($show['type'] == 'transfer') { ?>
            <!--转账-->
            <div class="m_hide" id="m_transfer" style="display:block;">
                <form class="validform" method="post" action="/bill/edit/<?=$show['id']?>/">
                    <dl><dt>时间：</dt><dd><input type="text" name="row[occurtime]" id="occurtime_transfer" class="input datepicker" value="<?= date("Y-m-d", $show['occurtime']) ?>" title="点击选择日期" size="10" style="width:100px;" datatype="*" readonly="true" errormsg="日期输入错误！" autocomplete="off" /></dd></dl>
                    <dl><dt>转出：</dt>
                        <dd>
                            <select name="row[account_id]" id="account_id_transfer" datatype="*,notequal" notequal="inaccount_id_transfer" class="select" errormsg="转出和转入账户不能相同" nullmsg="请选择账户">
                                <?= get_account_option(null, $show['account_id']); ?>
                            </select>
                            &nbsp;<a href="/account/add/" title="新增账户" class="dialog account_add" callback="account_callback"><img src="<?= $config['res_url'] ?>/images/modify.gif" alt="" /></a>
                        </dd></dl>
                    <dl><dt>转入：</dt>
                        <dd>
                            <select name="row[inaccount_id]" id="inaccount_id_transfer" datatype="*,notequal" notequal="account_id_transfer" class="select" errormsg="转出和转入账户不能相同" nullmsg="请选择账户">
                                <?= get_account_option(null, $show['inaccount_id']); ?>
                            </select>
                            &nbsp;<a href="/account/add/" title="新增账户" class="dialog account_add" callback="account_callback"><img src="<?= $config['res_url'] ?>/images/modify.gif" alt="" /></a>
                        </dd></dl>
                    <dl><dt>金额：</dt><dd><input type="text" name="row[amount]" value="<?= $show['amount'] ?>" class="input calculator" size="5" maxlength="8" datatype="dec1" nullmsg="金额不能为空" errormsg="金额格式错误" /></dd></dl>
                    <dl><dt>说明：</dt><dd><textarea name="row[memo]" cols="55" rows="4" class="textarea"><?= $show['memo'] ?></textarea></dd></dl>
                    <dl><dt>&nbsp;</dt>
                        <dd>
                            <a href="javascript:void(0);" class="moreup" obj="moreconf"><span class="arrow"><em class="up">◆</em></span> 高级选项</a>
                            <div class="moreconf" style="clear:both;">
                                <input type="checkbox" name="row[notinfamily]" value="1" <?= checkchecked(0, $show['family']) ?> id="c_notinfamily_transfer" class="checkbox" /> <label for="c_notinfamily_transfer">不在家庭中显示</label>
                            </div>
                        </dd></dl>
                    <dl><dt>&nbsp;</dt>
                        <dd>
                            <a href="javascript:;" class="btn btn_s submit"><span><b class="icon icon-ok"></b><em>提交</em></span></a>
                            <a href="javascript:;" class="btn btn_w_s cancel"><span><b class="icon icon-remove"></b><em>取消</em></span></a>
                            <span class="poststate"><em>&nbsp;</em><b></b></span>
                        </dd></dl>
                </form>
            </div>
        <?php } else if ($show['type'] == 'borrow') { ?>
            <!--借款报销-->
            <div class="m_hide" id="m_borrow" style="display:block;">
                <form class="validform" method="post" action="/bill/edit/<?=$show['id']?>/">
                    <dl><dt>时间：</dt><dd><input type="text" name="row[occurtime]" id="occurtime_borrow" class="input datepicker" value="<?= date("Y-m-d", $show['occurtime']) ?>" title="点击选择日期" size="10" style="width:100px;" datatype="*" readonly="true" errormsg="日期输入错误！" autocomplete="off" /></dd></dl>
                    <dl><dt>类别：</dt><dd>
                            <input type="radio" name="row[category_id]" class="radio" id="c_borrowout" value="1" checked /> <label for="c_borrowout">借出</label>
                            <input type="radio" name="row[category_id]" class="radio" id="c_borrowin" value="2" /> <label for="c_borrowin">借入</label>
                        </dd></dl>
                    <dl><dt>账户：</dt>
                        <dd>
                            <select name="row[account_id]" id="account_id_borrow" class="select" datatype="*" nullmsg="请选择账户">
                                <?= get_account_option(null, $show['account_id']); ?>
                            </select>
                            &nbsp;<a href="/account/add/" title="新增账户" class="dialog account_add" callback="account_callback"><img src="<?= $config['res_url'] ?>/images/modify.gif" alt="" /></a>
                        </dd></dl>
                    <dl><dt>金额：</dt><dd><input type="text" name="row[amount]" value="<?= $show['amount'] ?>" class="input calculator" size="5" maxlength="8" datatype="dec1" nullmsg="金额不能为空" errormsg="金额格式错误" /></dd></dl>
                    <dl><dt>说明：</dt><dd><textarea name="row[memo]" cols="55" rows="4" class="textarea"><?= $show['memo'] ?></textarea></dd></dl>
                    <dl><dt>&nbsp;</dt>
                        <dd>
                            <input type="checkbox" name="row[borrowdate]" value="1" id="c_continue_borrowdate" class="checkbox" /> <label for="c_continue_borrowdate">收款日期</label> 
                            <a href="javascript:void(0);" class="moreup" obj="moreconf"><span class="arrow"><em class="up">◆</em></span> 高级选项</a>
                            <div class="moreconf" style="clear:both;">
                                <input type="checkbox" name="row[notinfamily]" value="1" <?= checkchecked(0, $show['family']) ?> id="c_notinfamily_borrow" class="checkbox" /> <label for="c_notinfamily_borrow">不在家庭中显示</label>
                            </div>
                        </dd></dl>
                    <dl><dt>&nbsp;</dt>
                        <dd>
                            <a href="javascript:;" class="btn btn_s submit"><span><b class="icon icon-ok"></b><em>提交</em></span></a>
                            <a href="javascript:;" class="btn btn_w_s cancel"><span><b class="icon icon-remove"></b><em>取消</em></span></a>
                            <span class="poststate"><em>&nbsp;</em><b></b></span>
                        </dd></dl>
                </form>
            </div>
        <?php } else if ($show['type'] == 'credit') { ?>
            <!--信用卡还款-->
            <div class="m_hide" id="m_credit" style="display:block;">
                <form class="validform" method="post" action="/bill/edit/<?=$show['id']?>/">
                    <dl><dt>时间：</dt><dd><input type="text" name="row[occurtime]" id="occurtime_credit" class="input datepicker" value="<?= date("Y-m-d", $show['occurtime']) ?>" title="点击选择日期" size="10" style="width:100px;" datatype="*" readonly="true" errormsg="日期输入错误！" autocomplete="off" /></dd></dl>
                    <dl><dt>账户：</dt>
                        <dd>
                            <select name="row[account_id]" id="account_id_credit" class="select" datatype="*,notequal" notequal="inaccount_id_credit" nullmsg="请选择账户" errormsg="转出账户和还款信用卡不能相同">
                                <?= get_account_option(null, $show['account_id']); ?>
                            </select>
                            &nbsp;<a href="/account/add/" title="新增账户" class="dialog account_add" callback="account_callback"><img src="<?= $config['res_url'] ?>/images/modify.gif" alt="" /></a>
                        </dd></dl>
                    <dl><dt>信用卡:</dt>
                        <dd>
                            <select name="row[inaccount_id]" id="inaccount_id_credit" credit="true" class="select" datatype="*,notequal" notequal="account_id_credit" nullmsg="请选择信用卡" errormsg="转出账户和还款信用卡不能相同">
                                <?= get_account_option('credit', $show['inaccount_id']); ?>
                            </select>
                            &nbsp;<a href="/account/add/" title="新增信用卡" data="type=credit" class="dialog account_add" callback="account_callback" type="credit"><img src="<?= $config['res_url'] ?>/images/modify.gif" alt="" /></a>
                        </dd></dl>
                    <dl><dt>金额：</dt><dd><input type="text" name="row[amount]" value="<?= $show['amount'] ?>" class="input calculator" size="5" maxlength="8" datatype="dec1" nullmsg="金额不能为空" errormsg="金额格式错误" /></dd></dl>
                    <dl><dt>说明：</dt><dd><textarea name="row[memo]" cols="55" rows="4" class="textarea"><?= $show['memo'] ?></textarea></dd></dl>
                    <dl><dt>&nbsp;</dt>
                        <dd>
                            <a href="javascript:void(0);" class="moreup" obj="moreconf"><span class="arrow"><em class="up">◆</em></span> 高级选项</a>
                            <div class="moreconf hidden" style="clear:both;">
                                <input type="checkbox" name="row[notinfamily]" value="1" <?= checkchecked(0, $show['family']) ?> id="c_notinfamily_credit" class="checkbox" /> <label for="c_notinfamily_credit">不在家庭中显示</label>
                            </div>
                        </dd></dl>
                    <dl><dt>&nbsp;</dt>
                        <dd>
                            <a href="javascript:;" class="btn btn_s submit"><span><b class="icon icon-ok"></b><em>提交</em></span></a>
                            <a href="javascript:;" class="btn btn_w_s cancel"><span><b class="icon icon-remove"></b><em>取消</em></span></a>
                            <span class="poststate"><em>&nbsp;</em><b></b></span>
                        </dd></dl>
                </form>
            </div>
        <?php } ?>
    </div>
</div>
<script type="text/javascript">
    KS.common.load('bill.edit');
</script>